#ifndef _CONFIG_H
#define _CONFIG_H

#define DEBUGTRACE        1  //是否输出调试信息

#if DEBUGTRACE
#define traceprintf     printf
#else
#define traceprintf
#endif

#define DEBUG_SAVE_MIX_PCM       0 //是否生成混音文件
#define DEBUG_SAVE_RECV_PCM      0
#define DEBUG_SAVE_PLAY_PCM      0 
#define DEBUG_SAVE_SEND_PCM      0
#define DEBUG_SAVE_CAPTURE_PCM   0


#define SOUND_OSS                1
#define SOUND_ALSA               2
#define SOUND_INTERFACE          SOUND_OSS

#define BUFFER_COUNT                5 //接收端缓冲区有该数量才允许播放
#define SAMPLERATE              32000 //定义采样率
#define CHANNELS                    1 //单声道采样
#define READMSFORONCE              10 //采样周期(ms)
#define BUFFERNODECOUNT            128 //链表节点个数

//char buffer[SAMPLERATE/1000*READMSFORONCE*sizeof(short)];
#define SAMPLES_FOR_EACH_TIME     SAMPLERATE/1000*READMSFORONCE  //一次获取多少样本

//数据包包头,包括版本号, 编解码等
typedef struct
{
    unsigned int FrameNO;//帧序号
    unsigned int valid;
    unsigned int sec;
    unsigned int usec;
}pk_hdr_t;
 
struct AudioBuffer;
typedef struct AudioBuffer
{
    unsigned char buffer[sizeof(pk_hdr_t) + SAMPLERATE/1000*CHANNELS*READMSFORONCE*sizeof(short)];
    struct AudioBuffer  *pNext;
} AUDIOBUFFER;

#endif
